package com.sky.service.common.impl;

import com.sky.entity.Category;
import com.sky.mapper.CategoryMapper;
import com.sky.service.common.CommonCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("commonCategoryService")
@Slf4j
public class CommonCommonCategoryServiceImpl implements CommonCategoryService {

    private final CategoryMapper categoryMapper;

    @Autowired
    public CommonCommonCategoryServiceImpl(CategoryMapper categoryMapper) {
        this.categoryMapper = categoryMapper;
    }

    /**
     * 根据分类信息获取分类实体集合
     *
     * @param categoryType 分类信息
     * @return 分类实体类集合
     */
    @Override
    public List<Category> listCategory(Integer categoryType) {
        log.info("执行根据分类信息获取分类实体集合业务: {}", categoryType);
        return categoryMapper.listCategory(categoryType);
    }
}
